package com.power.sifa.net.api;

import com.plf.common.domain.ResponseDTO;
import com.power.sifa.net.model.Lookup;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

public interface lookupApi {

    /**
     * 回显表单(自动初始化)
     */
    @PostMapping("/executor/lookupOne")
    ResponseDTO lookupOne(@RequestBody Lookup lookup) throws Exception;

    /**
     * 回显表单list
     */
    @PostMapping("/executor/lookupList")
    ResponseDTO lookupList(@RequestBody Lookup lookup) throws Exception;

    /**
     * lookup根据企业表数据存储到申请表和返回
     * @param applyid
     * @param lookup
     * @return
     * @throws Exception
     */
    @PostMapping("/executor/lookupAplInit")
    ResponseDTO lookupAplInit(String applyid, @RequestBody Lookup lookup) throws Exception;

    /**
     * lookup批量根据企业表数据存储到申请表和返回
     * @param applyid
     * @param lookupList
     * @return
     * @throws Exception
     */
    @PostMapping("/executor/lookupAplBatchInit")
    ResponseDTO lookupAplBatchInit(String applyid, @RequestBody List<Lookup> lookupList) throws Exception;


    /**
     * 回显申请表单条数据
     * @param applyid
     * @param apltable
     * @return
     * @throws Exception
     */
    @PostMapping("/executor/lookupOneApl")
    ResponseDTO lookupAplByid(String applyid, String apltable) throws Exception;

    /**
     * 保存申请表单条数据
     * @param apltable
     * @param body
     * @return
     * @throws Exception
     */
    @PostMapping("/executor/lookupSaveApl")
    ResponseDTO lookupSaveApl(String apltable, @RequestBody Map<String, Object> body) throws Exception;

    /**
     * 批量保存申请表数据
     * @param apltable
     * @param body
     * @return
     * @throws Exception
     */
    @PostMapping("/executor/lookupBatchSaveApl")
    ResponseDTO lookupBatchSaveApl(String apltable, @RequestBody List<Map<String, Object>> body) throws Exception;

}
